var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.curNodeEventEnd(true);
            cm.eventSKill(0);
            cm.setInGameDirectionMode(true, false, true);
            cm.inGameDirectionEvent_SetAdditionalEffectVisibleForInGameDirection2();
            cm.fieldEffect_InsertCanvas(1, 255, 0, 0, 0, 0, 0);
            cm.setStandAloneMode(true);
            cm.inGameDirectionEvent_PushScaleInfo(0, 0, 1500, 0, 2, -60);
            cm.curNodeEventEnd(true)
        } else {
            if (status === a++) {
                cm.npc_ChangeController(3004461, "oid=505526", 369, -1011, 29, 319, 419, 1, false, 0, false);
                cm.npc_SetSpecialAction("oid=505526", "summon", 0, 0);
                cm.npc_ChangeController(3004461, "oid=505527", 175, -1011, 29, 125, 225, 1, false, 0, false);
                cm.npc_SetSpecialAction("oid=505527", "summon", 0, 0);
                cm.npc_ChangeController(3004460, "oid=505528", -192, -762, 26, -242, -142, 0, true, 0, false);
                cm.npc_SetSpecialAction("oid=505528", "summon", 0, 0);
                cm.npc_ChangeController(3004461, "oid=505529", -390, -751, 25, -440, -340, 0, false, 0, false);
                cm.npc_SetSpecialAction("oid=505529", "summon", 0, 0);
                cm.npc_ChangeController(3004460, "oid=505530", 427, -696, 6, 377, 477, 1, true, 0, false);
                cm.npc_SetSpecialAction("oid=505530", "summon", 0, 0);
                cm.npc_ChangeController(3004461, "oid=505531", 221, -696, 27, 171, 271, 1, false, 0, false);
                cm.npc_SetSpecialAction("oid=505531", "summon", 0, 0);
                cm.npc_ChangeController(3004433, "oid=505532", -386, -36, 3, -436, -336, 0, true, 0, false);
                cm.npc_SetSpecialAction("oid=505532", "summon", 0, 0);
                cm.npc_ChangeController(3004431, "oid=505533", -216, -36, 3, -266, -166, 0, true, 0, false);
                cm.npc_SetSpecialAction("oid=505533", "summon", 0, 0);
                cm.npc_ChangeController(3004437, "oid=505534", 10, -36, 5, -40, 60, 0, true, 0, false);
                cm.npc_SetSpecialAction("oid=505534", "summon", 0, 0);
                cm.npc_ChangeController(3004436, "oid=505535", -100, -36, 5, -150, -50, 0, true, 0, false);
                cm.npc_SetSpecialAction("oid=505535", "summon", 0, 0);
                cm.npc_ChangeController(3004460, "oid=505536", 418, -281, 11, 368, 468, 1, true, 0, false);
                cm.npc_SetSpecialAction("oid=505536", "summon", 0, 0);
                cm.npc_ChangeController(3004461, "oid=505537", 262, -279, 10, 212, 312, 1, false, 0, false);
                cm.npc_SetSpecialAction("oid=505537", "summon", 0, 0);
                cm.npc_ChangeController(3004437, "oid=505538", -14, -282, 9, -64, 36, 0, true, 0, false);
                cm.npc_SetSpecialAction("oid=505538", "summon", 0, 0);
                cm.npc_SetSpecialAction("oid=505538", "special4", -1, 1);
                cm.fieldEffect_InsertCanvas(1, 255, 0, 0, 0, 0, 0);
                cm.inGameDirectionEvent_AskAnswerTime(1200)
            } else {
                if (status === a++) {
                    cm.fieldEffect_InsertCanvas(0, 0, 0, 0, 0, 1000, 0);
                    cm.inGameDirectionEvent_AskAnswerTime(1400)
                } else {
                    if (status === a++) {
                        cm.inGameDirectionEvent_AskAnswerTime(1500)
                    } else {
                        if (status === a++) {
                            cm.fieldEffect_PlayBGM("SoundEff.img/ArcaneRiver/thrill", 0, 0);
                            cm.sendNormalTalk_Bottom("#face0#是王子。其他都是些不认识的家伙。", 37, 3004460, false, true)
                        } else {
                            if (status === a++) {
                                cm.inGameDirectionEvent_PushScaleInfo(3000, 0, 1500, 3000, 2, -901)
                            } else {
                                if (status === a++) {
                                    cm.inGameDirectionEvent_AskAnswerTime(4000)
                                } else {
                                    if (status === a++) {
                                        cm.sendNormalTalk_Bottom("#face0#好像被包围了。", 37, 3004437, false, true);
                                        cm.effect_Voice("Voice5.img/CH2/Knight/2", 128)
                                    } else {
                                        if (status === a++) {
                                            cm.inGameDirectionEvent_AskAnswerTime(2500)
                                        } else {
                                            if (status === a++) {
                                                cm.inGameDirectionEvent_AskAnswerTime(1500)
                                            } else {
                                                if (status === a++) {
                                                    cm.inGameDirectionEvent_PushScaleInfo(3000, 0, 1500, 3000, 2, -60)
                                                } else {
                                                    if (status === a++) {
                                                        cm.inGameDirectionEvent_AskAnswerTime(3000)
                                                    } else {
                                                        if (status === a++) {
                                                            cm.sendNormalTalk_Bottom("#face0#是翼人军吗？", 37, 3004431, false, true);
                                                            cm.effect_Voice("Voice5.img/CH2/Idea/6", 128)
                                                        } else {
                                                            if (status === a++) {
                                                                cm.sendNormalTalk_Bottom("#face1#不是这样的。他们是……他们都是#r违背神明#k，企图#r破坏圣地#k的不法之徒。", 37, 3004433, true, true);
                                                                cm.effect_Voice("Voice5.img/CH2/Carlyle/3", 128)
                                                            } else {
                                                                if (status === a++) {
                                                                    cm.sendNormalTalk_Bottom("#face4#什么？", 37, 3004431, true, true);
                                                                    cm.effect_Voice("Voice5.img/CH2/Idea/7", 128)
                                                                } else {
                                                                    if (status === a++) {
                                                                        cm.sendNormalTalk_Bottom("#face1#毕竟神谕已有数百年未曾降临了。", 37, 3004433, true, true);
                                                                        cm.effect_Voice("Voice5.img/CH2/Carlyle/4", 128)
                                                                    } else {
                                                                        if (status === a++) {
                                                                            cm.inGameDirectionEvent_AskAnswerTime(2000)
                                                                        } else {
                                                                            if (status === a++) {
                                                                                cm.fieldEffect_InsertCanvas(1, 255, 0, 0, 0, 500, 0);
                                                                                cm.inGameDirectionEvent_AskAnswerTime(500)
                                                                            } else {
                                                                                if (status === a++) {
                                                                                    cm.warp(993141100, 0, false);
                                                                                    cm.eventSKill(0);
                                                                                    cm.setInGameDirectionMode(false, true, false);
                                                                                    cm.setStandAloneMode(false);
                                                                                    cm.npc_LeaveField("oid=505526");
                                                                                    cm.npc_LeaveField("oid=505527");
                                                                                    cm.npc_LeaveField("oid=505528");
                                                                                    cm.npc_LeaveField("oid=505529");
                                                                                    cm.npc_LeaveField("oid=505530");
                                                                                    cm.npc_LeaveField("oid=505531");
                                                                                    cm.npc_LeaveField("oid=505532");
                                                                                    cm.npc_LeaveField("oid=505532");
                                                                                    cm.npc_LeaveField("oid=505533");
                                                                                    cm.npc_LeaveField("oid=505533");
                                                                                    cm.npc_LeaveField("oid=505534");
                                                                                    cm.npc_LeaveField("oid=505534");
                                                                                    cm.npc_LeaveField("oid=505535");
                                                                                    cm.npc_LeaveField("oid=505535");
                                                                                    cm.npc_LeaveField("oid=505536");
                                                                                    cm.npc_LeaveField("oid=505536");
                                                                                    cm.npc_LeaveField("oid=505537");
                                                                                    cm.npc_LeaveField("oid=505537");
                                                                                    cm.npc_LeaveField("oid=505538");
                                                                                    cm.npc_LeaveField("oid=505538");
                                                                                    cm.dispose()
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
};